import service from "@/service";
import Qs from "qs";
//导出材料波动数据
export function exportMaterialTableData(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/downloadMaterialFluctuation`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//材料波动图表数据
export function getMaterialFluctuations(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/materialFluctuationChart`,
    method: "POST",
    data: parameter,
  });
}

//材料波动列表数据
export function getMaterialTableData(parameter) {
  let {
    secCode,
    equCode,
    startTime,
    endTime,
    ratioName,
    page,
    pageSize,
    projectName,
    strengthGrade,
    placePart,
  } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/materialFluctuationList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      secCode,
      equCode,
      startTime,
      endTime,
      ratioName,
      projectName,
      strengthGrade,
      placePart,
    },
  });
}
//材料波动列表详情
export function getMaterialDetailsInfo(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/mpDataCarList`,
    method: "GET",
    params,
  });
}

//混凝土输送布料数据【列表】
export function getClothPageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-cloth-data/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//混凝土输送布料数据【梁号下拉框】
export function getBLJBeamNoList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-cloth-data/queryComponentPartsList`,
    method: "POST",
    data,
  });
}

//振捣数据【列表】
export function getVibratePageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-boost-island/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//振捣数据详情
export function getVibrateDetail(data) {
  let { pId } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-boost-island/boostDataDetailStatics?pId=${pId}`,
    method: "POST",
  });
}

//振捣数据【梁号下拉框】
export function getZDQBeamNoList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-boost-island/queryComponentPartsList`,
    method: "POST",
    data,
  });
}
//养生数据-【列表】
export function getHealthList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//养生数据-【数据明细】
export function getHealthDetail(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/queryRealTimeDataList`,
    method: "POST",
    data,
  });
}
//养生数据-【温度分析】
export function getHealthAnalysis(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/temAnalysisTimeLength`,
    method: "POST",
    data,
  });
}
//养生数据-梁号下拉框
export function getZYBeamNoList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/queryComponentPartsList`,
    method: "POST",
    data,
  });
}

//喷淋 【列表】
export function getZYPLPageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//喷淋【温度分析】
export function getZYPLTemAnalysisTimeLength(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/temAnalysisTimeLength`,
    method: "POST",
    data,
  });
}

//喷淋【数据明细】
export function getZYPLRealTimeDataList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/queryRealTimeDataList`,
    method: "POST",
    data,
  });
}

//喷淋【梁号下拉框】
export function getPLBeamNoList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/queryComponentPartsList`,
    method: "POST",
    data,
  });
}

//张拉数据采集【列表】
export function zlList(parameter) {
  let {
    secCode,
    equCode,
    startTime,
    endTime,
    bridgeName,
    componentParts,
    trialResult,
    page,
    pageSize,
  } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/zlList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      secCode,
      equCode,
      startTime,
      endTime,
      bridgeName,
      componentParts,
      trialResult,
    },
  });
}
// 张拉数据采集【日期】
export function getZlHasDataDate(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryDate`,
    method: "GET",
    params,
  });
}

// 张拉报告下载
export function zlReportDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/reportDownLoad`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

// 张拉报告批量下载
export function zlBatchReportDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/batchReportDownLoad`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}
// 张拉数据详情
export function zlDetail(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/zlDetail`,
    method: "GET",
    params: parameter,
  });
}

//压浆数据【列表】
export function yjList(parameter) {
  let {
    secCode,
    equCode,
    startTime,
    endTime,
    bridgeName,
    componentParts,
    trialResult,
    page,
    pageSize,
  } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/yjList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      secCode,
      equCode,
      startTime,
      endTime,
      bridgeName,
      componentParts,
      trialResult,
    },
  });
}

// 压浆数据详情
export function yjDetail(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/yjDetail`,
    method: "GET",
    params: parameter,
  });
}

// 压浆数据【日期】
export function getYjHasDataDate(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/queryDate`,
    method: "GET",
    params,
  });
}

// 压浆报告下载
export function yjReportDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/reportDownLoad`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

// 压浆报告批量下载
export function yjBatchReportDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/batchReportDownLoad`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

// 起重设备首页列表
export function deviceHomeList(data) {
  let { page = 1, pageSize = 9999 } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSpecialEqu/equipmentList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//起重设备table列表
export function equipmentListByEquType(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSpecialEqu/equipmentListByEquType?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//关联设备-下拉框
export function getUnboundDeviceList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDevice/getUnboundDeviceList`,
    method: "POST",
    data: parameter,
  });
}

//新增特种设备
export function addEquiment(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSpecialEqu/save?${Qs.stringify(parameter)}`,
    method: "POST",
  });
}

//特种设备-删除
export function deleteEquiment(parameter) {
  let { id } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSpecialEqu/deleteData/?id=${id}`,
    method: "POST",
  });
}

//特种设备详情
export function getEquimentDetails(parameter) {
  let { id } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSpecialEqu/getDetail/?id=${id}`,
    method: "POST",
  });
}

//钢筋加工【列表】
export function getRebarProcessPage(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/queryByPage?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//钢筋加工【详情】
export function getRebarProcessDetail(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/detail`,
    method: "GET",
    params,
  });
}
//钢筋加工【接单】
export function receiveOrder(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/receiveOrder`,
    method: "POST",
    data,
  });
}

//钢筋加工【钢筋质检】
export function testOrder(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/testOrder`,
    method: "POST",
    data,
  });
}

//钢筋加工【生产加工】
export function produceOrder(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/produceOrder`,
    method: "POST",
    data,
  });
}

//钢筋加工【生产完成】
export function completeOrder(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/completeOrder`,
    method: "POST",
    data,
  });
}

//钢筋加工【退回】
export function returnOrder(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/returnOrder`,
    method: "POST",
    data,
  });
}

//钢筋加工【流程监控】
export function processMonitoring(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/processMonitoring`,
    method: "GET",
    params,
  });
}

//模版数据
export function getPedestalPage(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-template-data/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//模版数据【梁号下拉框】
export function getModelBeamNoList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-template-data/queryComponentPartsList`,
    method: "POST",
    data,
  });
}

//鱼雷罐数据
export function getTorpedoLadlePage(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-torpedo-ladle/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//模版下载
export function pedestalDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-template-data/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//鱼雷罐下载
export function torpedoLadleDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-torpedo-ladle/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//布料下载
export function concreteDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-cloth-data/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//振捣下载
export function vibrateDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-boost-island/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//蒸养/喷淋 下载
export function steamCuringDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//一梁一码 模版安装明细
export function getMBAZPage(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-template-data-detail/queryPageList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//要料申请
export function getYlsqList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcBeamInfo/getYlsqList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//试验数据
export function getSYList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beamTrial/trial-test-data/getListByComponentParts`,
    method: "POST",
    data,
  });
}

//起重设备数据-查询所有设备
export function getLMDEquipment(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/getLMDEqu`,
    method: "GET",
    params: parameter,
  });
}

//起重设备数据-查询历史记录
export function getLMDHistory(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/getList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//起重设备数据-预警推送
export function getLMDWarning(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/getWarnList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//起重设备数据-全部已读
export function setAllRead(data) {
  let { equCode } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/setAllRead?equCode=${equCode}`,
    method: "POST",
  });
}
//起重设备数据-批量已读
export function setPartRead(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/setPartRead`,
    method: "POST",
    data,
  });
}
//起重设备数据-详情
export function setLMDDetail(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/getDetail?id=${id}`,
    method: "POST",
  });
}

//起重设备数据-实时数据
export function setLMDSpecial(data) {
  let { equCode } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/specialLmd/querySpecialLmd?equCode=${equCode}`,
    method: "POST",
  });
}

//张拉下载
export function zlDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//压浆下载
export function yJDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/downLoadList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//拌合下载
export function bHDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/downloadMaterialFluctuation`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//养生明细数据下载
export function ysMXDownLoad(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/downLoadDetailList`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//张拉.压浆-查询梁号下拉框
export function getPartsList() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getCompleteAndProgressComponentparts`,
    method: "GET",
  });
}

//张拉数据保存
export function saveZlParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/updateComponentParts`,
    method: "POST",
    data,
  });
}

//压浆数据保存
export function saveYjParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/updateComponentParts`,
    method: "POST",
    data,
  });
}
